package com.gegao.practise;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;


public class TestTextViewAct extends Activity {
    Button mBt;
    TextView mSelectedTextView;
    int selectedCount;
    
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
        setContentView(R.layout.one_textview);
    
        mSelectedTextView = (TextView)this.findViewById(R.id.tv);
        
        mSelectedTextView.setText(R.string.one_add_to_readinglist);
        mBt = (Button)this.findViewById(R.id.bt);
        mBt.setOnClickListener(new OnClickListener() {
            
            @Override
            public void onClick(View v) {
                String str = "www.baidu.com";
                if(1 == selectedCount){
                    mSelectedTextView.setText(getResources().getString(R.string.one_links_downloading, str));
                    selectedCount = 2;
                }else{
                    mSelectedTextView.setText(getResources().getString(R.string.more_than_one_links_downloading, str));
                    selectedCount = 1;
                }
            }
        });
    }

}
